<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button onclick="alert('按钮1被按了')">按钮1</button>
		<button onclick="foo2()">按钮2</button>
		<button id="btn3">按钮3</button>
		<button id="btn4">按钮4</button>
		<script>
			function foo2()
			{
				alert("按钮2被按了");
			}
			btn3.onclick=function(){
				alert("按钮3被按了");
			}
			btn4.addEventListener("click",function(){
				alert("按钮4被按了aaa")
			});
			btn4.addEventListener("click",function(){
				alert("按钮4被按了bbb")
			});
		</script>
	</body>
</html>
